<?php
$Boleto = Dracosys::getSessionValue(SESSION_INTERFACE, 'Billet');
?>
<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <title>Boleto</title>
        <meta charset="utf-8">
        <link rel="stylesheet" href="<?= DRA_VIEW_URL ?>css/reset.css" type="text/css" media="all" />
        <link rel="stylesheet" href="<?= DRA_VIEW_URL ?>css/boleto.css" type="text/css" media="all" />
        <!--[if lt IE 7]>
          <script type="text/javascript" src="<?= DRA_VIEW_URL ?>js/ie_png.js"></script>
          <script type="text/javascript">
              ie_png.fix('.png, .logo img, header nav a, header .extra-navigation a, img.icon');
          </script>
        <![endif]-->
        <!--[if lt IE 9]>
              <script type="text/javascript" src="<?= DRA_VIEW_URL ?>js/html5.js"></script>
        <![endif]-->
        <script type="text/javascript" src="<?= DRA_VIEW_URL ?>js/jquery.1.6.2.js"></script>
        <script type="text/javascript" src="<?= DRA_VIEW_URL ?>js/dracosys.js"></script>
    </head>
    <body>
        <div id="billet">
            <header>
                <div id="logo">
                    <img src="<?= DRA_VIEW_URL ?>images/logo.png" alt="Dracosys-Logo" />
                </div>
                <div id="buy">
                    Descrição do Plano
                    <ul>
                        <li><?= $Boleto->getCustomer()->getFinanceiro()->getPlano()->getStNome() ?> - <?= $Boleto->getCustomer()->getFinanceiro()->getEnPeriodicidade() ?>: <?= MathUtils::money( $Boleto->getPrice() ) ?></li>
                    </ul>
                </div>
                <span id="invoice-total"> Total da Fatura: <?= MathUtils::money( $Boleto->getPrice() ) ?> </span>
            </header>
            <section id="content">
                <section id="TransferorData">
                    <div class="bankData"><?= $Boleto->getBank() ?> | <?= $Boleto->getBankCode() ?> | <span>Recibo Sacado</span></div>
                    <div id="paymentInfo">
                        <table>
                            <tbody>
                                <tr class="header">
                                    <td>Vencimento</td>
                                    <td>Agência/C&oacute;digo do Cedente</td>
                                    <td>Número do Documento</td>
                                    <td>Nosso Número/C&oacute;digo do Documento</td>
                                </tr>
                                <tr class="value">
                                    <td><?= dateBDtoBR( $Boleto->getMaturity() ) ?></td>
                                    <td><?= $Boleto->getAgency() ?> / <?= $Boleto->getTransferorCode() ?></td>
                                    <td>&nbsp;</td>
                                    <td><?= $Boleto->getOurNumber() ?></td>
                                </tr>
                                <tr class="header">
                                    <td>Valor do Documento</td>
                                    <td>(-) Descontos</td>
                                    <td>(+) Acr&eacute;scimos</td>
                                    <td>(=) Valor Cobrado</td>
                                </tr>
                                <tr class="value">
                                    <td><?= MathUtils::money( $Boleto->getPrice(), '' ) ?></td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div id="resumeData">
                        <table class="transferorResume">
                            <tbody>
                                <tr>
                                    <td class="header">Sacado</td>
                                    <td class="value">
                                        <?= $Boleto->getCustomer()->getCustomerName() ?><br />
                                        <?= $Boleto->getCustomer()->getFullAddress() ?><br />
                                        CEP: <?= $Boleto->getCustomer()->getArGeneralData('StCep') . ' ' . $Boleto->getCustomer()->getArGeneralData('StCidade') . '-' . $Boleto->getCustomer()->getArGeneralData('StEstado')?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="header">Cedente</td>
                                    <td class="value"><?= $Boleto->getTransferor() ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </section>
                <section id="PlugData">
                    <div class="bankData"><?= $Boleto->getBank() ?> | <?= $Boleto->getBankCode() ?> | <span><?= $Boleto->getDigitableLine() ?></span></div>
                    <table id="plug">
                        <tbody>
                            <tr>
                                <td colspan="6">
                                    <span class="title">Local de Pagamento</span>
                                    <span class="content"><?= $Boleto->getPaymentLocal() ?></span>
                                </td>
                                <td>
                                    <span class="title">Vencimento</span>
                                    <span class="important content"><?= dateBDtoBR( $Boleto->getMaturity() )?></span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <span class="title">Cedente</span>
                                    <span class="content"><?= $Boleto->getTransferor() ?></span>
                                </td>
                                <td>
                                    <span class="title">Agência/Código do Cedente</span>
                                    <span class="content"><?= $Boleto->getAgency() ?> / <?= $Boleto->getTransferorCode() ?></span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">Data do Documento</span>
                                    <span class="content"><?= dateBDtoBR( $Boleto->getProcessingDate() ) ?></span>
                                </td>
                                <td colspan="2">
                                    <span class="title">Número do Documento</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td>
                                    <span class="title">Espécie Doc</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td>
                                    <span class="title">Aceite</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td>
                                    <span class="title">Data do Processamento</span>
                                    <span class="content"><?= dateBDtoBR( $Boleto->getProcessingDate() )?></span>
                                </td>
                                <td>
                                    <span class="title">Nosso numero/Código do Documento</span>
                                    <span class="content"><?= $Boleto->getOurNumber() ?></span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">Uso do Boleto</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td>
                                    <span class="title">CIP</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td>
                                    <span class="title">Carteira</span>
                                    <span class="content"><?= $Boleto->getWallet() ?></span>
                                </td>
                                <td>
                                    <span class="title">Espécie</span>
                                    <span class="content">R$</span>
                                </td>
                                <td>
                                    <span class="title">Quantidade</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td><span class="title">(x) Valor</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                                <td><span class="title">(=) Valor do Documento</span>
                                    <span class="content important"><?=MathUtils::money( $Boleto->getPrice(), '' )?></span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6" rowspan="5">
                                    <span class="title">Instruções</span>
                                    <span class="content">
                                        <?= $Boleto->getInstructions() ?>
                                    </span>
                                </td>
                                <td>
                                    <span class="title">(-) Desconto / Abatimento</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">(-) Outras Deduções</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">(+) Mora / Multa</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">(+) Outros Acréscimos</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="title">(=) Valor Cobrado</span>
                                    <span class="content">&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="7">
                                    <table class="transferorResume">
                                        <tbody>
                                            <tr>
                                                <td class="header">Sacado</td>
                                                <td class="value">
                                                    <?= $Boleto->getCustomer()->getCustomerName() ?><br />
                                                    <?= $Boleto->getCustomer()->getFullAddress() ?><br />
                                                    CEP: <?= $Boleto->getCustomer()->getArGeneralData('StCep') . ' ' . $Boleto->getCustomer()->getArGeneralData('StCidade') . '-' . $Boleto->getCustomer()->getArGeneralData('StEstado')?>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="header">Cedente</td>
                                                <td class="value"><?= $Boleto->getTransferor() ?></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </section>
            </section>
            <footer>
                <img src="http://localhost/dracosys/plugins/barcode/" alt="Código" />
            </footer>
        </div>
    </body>
</html>
